﻿@using eCollabro.Client.Models.Content;
@using eCollabro.Client.Models.Core;
@using eCollabro.Web.Base;
@model BlogModel
@Scripts.Render("~/bundles/blog")
<div id="divBlogHome" ng-controller="blogHomeController" ng-init="initialize()">
    @Html.Partial("_PageHeader", new PageHeaderModel { ViewId = "BlogHome", PageTitle = "Blogs" })

    <div class="col-md-8">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">Recent Blogs <span class="badge">{{recentBlogs.length}}</span></div>
            <div class="panel-body">
                <ul class="list-group">
                    <li class="list-group-item" ng-repeat="blog in recentBlogs">
                        <h4 class="list-group-item-heading"><a href="/content/blog/blog/{{blog.BlogId}}">{{blog.BlogTitle}}</a></h4>
                        <p class="list-group-item-text"> {{blog.BlogDescription}}</p>
                    </li>
                </ul>
                <div ng-show="recentBlogs.length==0" class="text-info">There are no records to show.</div>
            </div>
        </div>
    </div>
    <div class="col-md-1"></div>
    <div style="min-height:40px" class="col-md-3">
        <div class="row">
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">Blog Categories <span class="badge">{{blogCategories.length}}</span></div>
                <div class="panel-body">
                    <ul class="list-group">
                        <li class="list-group-item" ng-repeat="blogCategory in blogCategories">
                            <span class="badge">{{blogCategory.NumberOfBlogs}}</span>
                            <a href="/content/blog/blogs/{{blogCategory.BlogCategoryId}}">{{blogCategory.BlogCategoryName}}</a>
                        </li>
                    </ul>
                    <div ng-show="blogCategories.length==0" class="text-info">There are no records to show.</div>
                </div>
            </div>

        </div>
    </div>
</div>
